/**
 * Handheld system management
*/
#include "main.h"
#include "thread_msg.h"
#include "local_msg.h"
#include "sys_log.h"

int main(int argc, char const* argv[])
{
    int ret= -1;
    char homepath[500];
	char rootpath[500];

    sys_log_info("app sys_manger_ali version: %s\n", MANGERS_VERSION);
    
    if (argc > 1) {
        sys_log_info("arg[1]=%s\n", argv[1]);
        if (strlen(argv[1]) >= 100) {
            sys_log_erro("param(%s) over buffer\n", argv[1]);
        }
        strncpy(rootpath, argv[1], 100);    
    }  else {
        strncpy(rootpath, DEFAULT_ROOT_PATH, 100);
    }

    ret = sys_init(rootpath);
	if (ret != 0) {
		sys_log_erro("sys init error\n");
		return -1;
	}

    while (1) {
        sleep(1000);
    }
    return 0;
}